package com.hkts.beltweigher.utils;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * @ClassNameResult
 * @Description
 * @Author yck
 * @Date2020-07-28 14:59
 * @Version V1.0
 **/
@Data
@ApiModel(value = "统一结果集")
public class Result<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 成功标志
     */
    @ApiModelProperty(value = "是否成功" )
    private boolean success;

    /**
     * 失败消息
     */
    @ApiModelProperty(value = "消息" )
    private String message;

    /**
     * 返回代码
     */
    @ApiModelProperty(value = "状态码 200 成功，401 重新登录，500 后台异常，404 找不到接口 " )
    private Integer code;

    /**
     * 时间戳
     */
    @ApiModelProperty(value = "时间戳" )
    private long timestamp = System.currentTimeMillis();

    /**
     * 结果对象
     */
    @ApiModelProperty(value = "结果对象" )
    private T result;
}
